Component({
  options: {
    multipleSlots: true // 在组件定义时的选项中启用多slot支持 
  },
  /**
   * 组件的属性列表
   */
  properties: {
    is: Boolean,
    proDetail: Object
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    numChange(e) {
      wx.$https('spcart.amount.modify', {
        spcartItemsId: this.data.proDetail.spcartItemsId,
        amount: e.detail
      })
      this.triggerEvent('numChange')
    },
    isChange() {
      this.setData({
        is: !this.data.is
      })
      this.triggerEvent('change')
      this.triggerEvent('numChange')
    },
    choose() {
      this.setData({
        is: true
      })
      this.triggerEvent('numChange')
    },
    noChoose() {
      this.setData({
        is: false
      })
      this.triggerEvent('numChange')
    },
    getIs() {
      return {
        ischoose: this.data.is,
        num: this.selectComponent('#step').getNum(),
        detail: this.data.proDetail
      }
    },
    navDetail() {
      let proDetail = this.data.proDetail
      let isShop = proDetail.shopId == 0 || proDetail.shopId == null ? false : true
      let id = isShop ? proDetail.goodsId : proDetail.goodsId //等数据
      wx.$nav('/pages/workerDetail/workerDetail', {
        goodsId: id
      })
    }
  }
})